/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package proyectois;
import java.io.*;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
 *
 * @author Administrador
 */
public class Fun_aux {
    Date fecha=new Date();
    
    public String input(String input) {
                return input;
    }

    public int inputInt(String prompt) { 
        while (true) { 
            try { 
                return Integer.parseInt(input(prompt), 10);
            } catch (NumberFormatException x) {}
        }
    }

    public double inputDouble(String prompt) { 
        while (true) { 
            try { 
                return Double.parseDouble(prompt);
            } catch (NumberFormatException x) {}
        }
    }
    
    public Date inputDate(String prompt){
        DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
        if(prompt.length()==10){
            try {
                Date today = df.parse(prompt);
            } catch (ParseException ex) {
                Logger.getLogger(Fun_aux.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        return fecha;
    }
}
